package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * @param: [ids]
     * @return: java.util.List<java.lang.Long>
     * @description: 根据 dish_id批量查询，也可以只传入一个id
     **/
    List<Long> getSetmealDishIds(List<Long> ids);

    /**
     * @param: [setmealDishes]
     * @return: void
     * @description: 新增套餐对应的菜品信息,注意这里没有公共字段,不需要AutoFill !!
     **/
    void insert(List<SetmealDish> setmealDishes);

    /**
     * @param: [ids]
     * @return: void
     * @description:批量删除套餐菜品信息
     **/
    void deleteBatch(List<Long> ids);

    /**
     * @param: [id]
     * @return: java.util.List<com.sky.entity.SetmealDish>
     * @description: 根据setmealId查询setmeal_dish信息
     **/
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    /**
     * @param: [id]
     * @return: void
     * @description: 根据套餐id删除单个菜品信息
     **/
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealId(Long id);
}
